import {adminUrl,teacherUrl} from "@/utils/baseUrl.js"
import request from '@/utils/request'

// 创建学校管理-班级
export function createClasses(data) {
  return request({
    url: adminUrl + '/collegebase/classes/create',
    method: 'post',
    data: data
  })
}

// 更新学校管理-班级
export function updateClasses(data) {
  return request({
    url: adminUrl + '/collegebase/classes/update',
    method: 'put',
    data: data
  })
}

// 删除学校管理-班级
export function deleteClasses(id) {
  return request({
    url: adminUrl + '/collegebase/classes/delete?id=' + id,
    method: 'delete'
  })
}

// 获得学校管理-班级
export function getClasses(id) {
  return request({
    url: teacherUrl + '/study/teacher/classes/info?id=' + id,
    method: 'get'
  })
}

// 获得班级中的学生
export function getClassesStudentPage(query) {
  return request({
    url: teacherUrl + '/collegebase/student-roll/page2',
    method: 'get',
    params: query
  })
}

// 获得学校管理-班级分页
export function getClassesPage(query) {
  return request({
    url: teacherUrl + '/collegebase/teacher-teachers/byTeacher/List',
    method: 'get',
    params: query
  })
}

// 导出学校管理-班级 Excel
export function exportClassesExcel(query) {
  return request({
    url: adminUrl + '/collegebase/classes/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
